//
//  CustomMGLAnnotationView.m
//  YueYueSpecailCarDriver
//
//  Created by 李亚军 on 2017/7/10.
//  Copyright © 2017年 黄旺鑫. All rights reserved.
//

#import "CustomMGLAnnotationView.h"

@implementation CustomMGLAnnotationView

- (UIImageView *)imageView {
    if (_imageView == nil) {
        
        self.imageView = [[UIImageView alloc] init];
    }
    return _imageView;
}

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        
        [self initDefaultAttributes];
    }
    
    return self;
}

- (void)initDefaultAttributes {
    
    [self addSubview:self.imageView];
    self.backgroundColor = [UIColor clearColor];
}

- (void)setFrame:(CGRect)frame {
    [super setFrame:frame];
    
    self.imageView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
